<?php 
define('_VIEW_MODEL_','default');
include("./init.php");
$result = $db->GetRow('select * from no_admin');
//$userId = getUserId();
$friend = "";
$novelsty = "";
require_once INC.'/pageclass.php';
//$pageObj = new Page(34,10,$smartyObj);
$id = isset($id)?intval($id):"";
$rs = $db->Execute("select `title`,`link` from {$telper}friendlink where state = 0 order by rank desc");
$friendinfo = $rs ->GetArray();
foreach($friendinfo as $k=>$v){
	$friend .="<a href='$v[link]'>$v[title]</a>";
	$k = $k+1;
	if($k%4 ==0 && count($friend)%4 != 0){
		$friend .="<br/>";
	}
	if($k%4 !=0 && count($friendinfo)>$k){
		$friend .=".";
	}
}
if(!empty($id)){
	$name = $db->GetRow("select name from {$telper}user where id = $id");
	$username = $name['name'];
}else{
	$username = "不存在";
}
foreach($novelstyle as $k=>$v){
	$novelsty .= "<a href='novel.php?acid=$k'>$v</a>";
	$k = $k+1;
	if($k%5 == 0 && count($novelstyle)%5 != 0){
		$novelsty .= "<br/>";
	}
	if($k%5 != 0 && count($novelstyle)>$k){
		$novelsty .= "|";
	}
}
$time =time();
header("Content-type:text/vnd.wap.wml;charset=utf-8");
$smartyObj->assign('friendlink',$friend);
$smartyObj->assign('nostyle',$novelsty);
$smartyObj->assign("uid",$id);
$smartyObj->assign("time",$time);
$smartyObj->assign("name",$username);
$smartyObj->display("index.tpl");

?>